"""
---------------------------------------------------------------------
- File: decorators.py
- Date: 2025/10/31
- Author: yangzhide
- Email: xxzjyzd@126.com
- Description:  装饰器
---------------------------------------------------------------------
"""


# 手工实现无参数装饰器

def wrapper(func):
    def inner():
        print('装饰器开始执行')
        func()
        print('装饰器结束执行')
    return inner

def log():
    print('正在记录日志....')

# 单独执行
log()
print('------------------')
# # 调用装饰器
# log = wrapper(log)
# log()
@wrapper
def log2():
    print('正在记录日志2....')

log2()